package com.gzhryc.shared_device.oem.code.place.dao.db;

import java.util.Date;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Join;
import com.gzhryc.jdbc.annotaion.PrimaryKey;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.shared_device.oem.code.config.dao.db.FuncModel;
import com.gzhryc.shared_device.oem.code.place.dao.enums.ClerkFuncModelEnum;

@Table(name="clerk_func_model")
public class ClerkFuncModel {

	@PrimaryKey
    @Column(name = "user_id", note = "用户ID")
    protected Long userId;

    @PrimaryKey
    @Column(name = "merchant_user_id", note = "商户用户ID")
    protected Long merchantUserId;
    
    @PrimaryKey
    @Column(name = "func_model_id", notNull = true)
    protected Long funcModelId;

    @Column(notNull = true, defVal = "1", note = "状态")
    private Integer state;

    @Column(name = "update_date", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;
    
    @Join(fromField = "func_model_id")
    protected FuncModel funcModel;

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getMerchantUserId() {
		return merchantUserId;
	}

	public void setMerchantUserId(Long merchantUserId) {
		this.merchantUserId = merchantUserId;
	}

	public Long getFuncModelId() {
		return funcModelId;
	}

	public void setFuncModelId(Long funcModelId) {
		this.funcModelId = funcModelId;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public FuncModel getFuncModel() {
		return funcModel;
	}

	public void setFuncModel(FuncModel funcModel) {
		this.funcModel = funcModel;
	}
	
	public String getStateName() {
		return ClerkFuncModelEnum.State.note(this.state);
	}
}
